/**
 * 添加script标签
 * @param {Object} name
 */
function addJScript(name) {
	document.writeln('<script type="text/javascript" src="' + name + '"></script>');
}
var thisPath = [].slice.call(document.scripts).map(function(p1) {
	var src = p1.src;
	if(p1.src.split('/').pop() === 'common.js') {
		return src.replace(location.origin, '').replace('common.js', '');
	}
	return false;
}).pop();

/**
 * 加载公共的js文件
 */
addJScript(thisPath + 'libs/mui.js');
addJScript(thisPath + 'libs/vue.min.js');
addJScript(thisPath + 'libs/vue-i18n.js');
addJScript(thisPath + 'libs/mui.pullToRefresh.js');
addJScript(thisPath + 'libs/mui.pullToRefresh.material.js');
//基础语言包
addJScript(thisPath.replace('js', 'i18n') + 'base.js');

addJScript(thisPath + 'common/app-config.js');
addJScript(thisPath + 'common/common-tool.js');
addJScript(thisPath + 'common/app-data-manager.js');
addJScript(thisPath + 'common/base-request.js');
addJScript(thisPath + 'common/utils.js');
addJScript(thisPath + 'element/toggle.js');

//压缩以后的文件
//addJScript(thisPath + 'common-build.js');
// 最后替换成压缩以后的版本了
// addJScript(thisPath + 'common-concat.min.js');
// 加载文件的locale文件
addJScript(location.href.replace('dist/', 'i18n/').replace('.html', '.js'));